<template>
    <el-menu
      default-active="2"
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose">
      <el-menu-item index="1" @click="transPer('personalData')">
        <i class="el-icon-menu"></i>
        <span slot="title">个人信息</span>
      </el-menu-item>
      <el-menu-item index="2" @click="transPer('charts')">
        <i class="el-icon-menu"></i>
        <span slot="title">任务完成数据</span>
      </el-menu-item>
      <el-menu-item index="3" @click="transPer('password')">
        <i class="el-icon-menu"></i>
        <span slot="title">修改密码</span>
      </el-menu-item>

      <!-- <el-submenu index="4" @click="transPer('personalData')">

        <template slot="title">
          <i class="el-icon-menu"></i>
          <span>个人信息</span>
        </template>

        <el-menu-item-group>
          <template slot="title">修改密码</template>
            <el-menu-item index="3-1">选项1</el-menu-item>
            <el-menu-item index="3-2">选项2</el-menu-item>
            <el-menu-item index="3-3">选项3</el-menu-item>
        </el-menu-item-group>
      </el-submenu> -->
    </el-menu>
</template>
<script>
export default {
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    transPer(data) {
      this.$emit("check", data);
    }
  },
  data() {
    return {
      listData: ["个人信息", "bug提交数量", "修改密码"]
    };
  }
};
</script>
<style lang="stylus" scoped rel="stylesheet/stylus">
.el-menu-vertical-demo
    width 200px
    height 1000px
    text-align left
</style>
